//
//  DCEvaluateViewController.m
//  JiuyaoMotorcade
//
//  Created by 大橙子 on 2018/12/3.
//  Copyright © 2018 Tomous. All rights reserved.
//

#import "DCEvaluateViewController.h"
#import "DCEvaluateFirstController.h"
#import "DCEvaluateSecondController.h"
#import "DCEvaluateThirdController.h"
#import "DCEvaluateForthController.h"
@interface DCEvaluateViewController ()
@property (nonatomic,copy) NSString *driverName;
@property (nonatomic, strong) ZWMSegmentController *segmentVC;
@end

@implementation DCEvaluateViewController
-(instancetype)initWithDriver:(NSString *)driverName {
    if (self = [super init]) {
        self.driverName = driverName;
    }
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = [NSString stringWithFormat:@"%@的评价",Str_IsEmpty(self.driverName)?@"":self.driverName];
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self setUpViewControllers];
}
-(void)setUpViewControllers{
    DCEvaluateFirstController *firstVC = [[DCEvaluateFirstController alloc] init];
    DCEvaluateSecondController *secondVC = [[DCEvaluateSecondController alloc] init];
    DCEvaluateThirdController *thirdVC = [[DCEvaluateThirdController alloc] init];
    DCEvaluateForthController *forthVC = [[DCEvaluateForthController alloc] init];
    
    NSArray *array = @[firstVC,secondVC,thirdVC,forthVC];
    
    NSArray *titleArray = @[@"全部(10)",@"好评(100)",@"中评(90)",@"差评(10)"];
    self.segmentVC = [ZWMSegmentController segmentControllerWithFrame:self.view.bounds Titles:titleArray type:1];
    self.segmentVC.segmentView.showSeparateLine = YES;
    self.segmentVC.segmentView.segmentTintColor = BlueColor;
    self.segmentVC.viewControllers = [array copy];
//    if (array.count==1) {
//        self.segmentVC.segmentView.style=ZWMSegmentStyleDefault;
//    } else {
//    }
    self.segmentVC.segmentView.style=ZWMSegmentStyleFlush;
//    [self.segmentVC  enumerateBadges:@[@10,@21,@13]];
    [self addSegmentController:self.segmentVC];
    [self.segmentVC  setSelectedAtIndex:0];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
